package com.xuhui.demo.service.impl;

import com.xuhui.demo.bean.Book;
import com.xuhui.demo.mapper.BookDao;
import com.xuhui.demo.service.BookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author XuHui
 * @version 1.0
 */
@Service
@Transactional
public class BookServiceImpl implements BookService {
    @Autowired
    private BookDao bookDao;

    @Override
    public void add(Book book) {
        bookDao.save(book);
    }

    @Override
    public void delete(int id) {
        bookDao.delete(id);
    }

    @Override
    public void update(Book book) {
        bookDao.update(book);
    }

    @Override
    public Book find(int id) {
        return bookDao.find(id);
    }


}
